<template>
  <div class="zuoping">
    <div class="title1">
      <div class="text1">
        参照
        <div class="text2">2678394</div>
        菜谱，大家做出
        <div class="text2">68807903</div>
        作品
      </div>
      <div class="dierhang">
        <div class="all">最新上传</div>
        <div class="all">正在流行</div>
        <div class="all">24小时最佳</div>
      </div>
    </div>
    <div v-for="(item, index) in tip" class="zpbox">
      <div class="title2">#{{ title[index] }}#</div>
      <div class="title2 title3">{{ item }}</div>
      <img :src="img[index]" alt="" />
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tip: [],
      img: [],
      title: [],
    };
  },
  async mounted() {
    var tip = [];
    var img = [];
    var title = [];
    this.$axios("/zztz/zuoping").then((res) => {
      res.data.map((el) => {
        tip.push(el.tip);
        img.push(el.img);
        title.push(el.title);
      });
      this.tip = tip;
      this.img = img;
      this.title = title;
    });
  },
};
</script>

<style scoped="scoped">
.zuoping {
  width: 660px;
  height: 820px;
  /* background-color: royalblue; */
  position: absolute;
  left: -10px;
  top: 2470px;
}
.title1 {
  padding: 32px;
  background-color: #f5f6f5;
  margin-bottom: 4px;
}
.title1 .text1,
.text2 {
  display: inline-block;
  font-size: 24px;
  font-weight: 700;
}
.title1 .text1 {
  color: #c0ae7d;
}
.title1 .text2 {
  color: #ec6c3f;
}
.dierhang {
  margin-top: 16px;
}
.all {
  display: inline-block;
  color: #dd3915;
  cursor: pointer;
  font-weight: 700;
  margin-right: 33px;
}
.all:hover {
  background-color: #dd3915;
  color: white;
}
.zpbox {
  width: 660px;
  height: 113px;
  box-sizing: border-box;
  /* background-color: pink; */
  margin-bottom: 4px;
  padding: 16px;
  background-color: #f5f6f5;
  position: relative;
  cursor: pointer;
}
.title2 {
  font-size: 16px;
  padding-top: 5px;
  padding-left: 20px;
}
.title3 {
  font-size: 12px;
  color: #909090;
}
.zpbox img {
  width: 82px;
  height: 82px;
  position: absolute;
  right: 40px;
  top: 14px;
}
.zpbox:hover {
  background-color: rgb(240, 241, 240);
}
</style>